package cn.iocoder.yudao.module.promotion.convert.quickcombinationactivity;

import cn.iocoder.yudao.module.promotion.controller.admin.quickcombinationactivity.vo.product.QuickCombinationProductRespVO;
import cn.iocoder.yudao.module.promotion.dal.dataobject.quickcombinationactivity.QuickCombinationProductDO;
import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;

import java.util.ArrayList;
import java.util.List;

@Mapper
public interface QuickCombinationProductConvert {
    QuickCombinationProductConvert INSTANCE = Mappers.getMapper(QuickCombinationProductConvert.class);

    QuickCombinationProductRespVO convert(QuickCombinationProductDO bean);

    default List<QuickCombinationProductRespVO> convertList(List<QuickCombinationProductDO> list){
        List<QuickCombinationProductRespVO> respVOList = new ArrayList<>();
        for(int i = 0; i<list.size(); i++){
            QuickCombinationProductRespVO respVO = convert(list.get(i));

            respVOList.add(respVO);
        }

        return respVOList;
    }
}
